<?php


abstract class BaseMujeres extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $id;


	
	protected $numhistoria;


	
	protected $ginocologo;


	
	protected $cito;


	
	protected $cito_frec;


	
	protected $resultado;


	
	protected $exa_gino;


	
	protected $embarazada;


	
	protected $dudas;


	
	protected $d_frec;


	
	protected $control;


	
	protected $cp_frec;


	
	protected $pro_emb;


	
	protected $mamografia;


	
	protected $its;

	
	protected $aHistoria;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getId()
	{

		return $this->id;
	}

	
	public function getNumhistoria()
	{

		return $this->numhistoria;
	}

	
	public function getGinocologo()
	{

		return $this->ginocologo;
	}

	
	public function getCito()
	{

		return $this->cito;
	}

	
	public function getCitoFrec()
	{

		return $this->cito_frec;
	}

	
	public function getResultado()
	{

		return $this->resultado;
	}

	
	public function getExaGino()
	{

		return $this->exa_gino;
	}

	
	public function getEmbarazada()
	{

		return $this->embarazada;
	}

	
	public function getDudas()
	{

		return $this->dudas;
	}

	
	public function getDFrec()
	{

		return $this->d_frec;
	}

	
	public function getControl()
	{

		return $this->control;
	}

	
	public function getCpFrec()
	{

		return $this->cp_frec;
	}

	
	public function getProEmb()
	{

		return $this->pro_emb;
	}

	
	public function getMamografia()
	{

		return $this->mamografia;
	}

	
	public function getIts()
	{

		return $this->its;
	}

	
	public function setId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = MujeresPeer::ID;
		}

	} 
	
	public function setNumhistoria($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->numhistoria !== $v) {
			$this->numhistoria = $v;
			$this->modifiedColumns[] = MujeresPeer::NUMHISTORIA;
		}

		if ($this->aHistoria !== null && $this->aHistoria->getNumhistoria() !== $v) {
			$this->aHistoria = null;
		}

	} 
	
	public function setGinocologo($v)
	{

		if ($this->ginocologo !== $v) {
			$this->ginocologo = $v;
			$this->modifiedColumns[] = MujeresPeer::GINOCOLOGO;
		}

	} 
	
	public function setCito($v)
	{

		if ($this->cito !== $v) {
			$this->cito = $v;
			$this->modifiedColumns[] = MujeresPeer::CITO;
		}

	} 
	
	public function setCitoFrec($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->cito_frec !== $v) {
			$this->cito_frec = $v;
			$this->modifiedColumns[] = MujeresPeer::CITO_FREC;
		}

	} 
	
	public function setResultado($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->resultado !== $v) {
			$this->resultado = $v;
			$this->modifiedColumns[] = MujeresPeer::RESULTADO;
		}

	} 
	
	public function setExaGino($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->exa_gino !== $v) {
			$this->exa_gino = $v;
			$this->modifiedColumns[] = MujeresPeer::EXA_GINO;
		}

	} 
	
	public function setEmbarazada($v)
	{

		if ($this->embarazada !== $v) {
			$this->embarazada = $v;
			$this->modifiedColumns[] = MujeresPeer::EMBARAZADA;
		}

	} 
	
	public function setDudas($v)
	{

		if ($this->dudas !== $v) {
			$this->dudas = $v;
			$this->modifiedColumns[] = MujeresPeer::DUDAS;
		}

	} 
	
	public function setDFrec($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->d_frec !== $v) {
			$this->d_frec = $v;
			$this->modifiedColumns[] = MujeresPeer::D_FREC;
		}

	} 
	
	public function setControl($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->control !== $v) {
			$this->control = $v;
			$this->modifiedColumns[] = MujeresPeer::CONTROL;
		}

	} 
	
	public function setCpFrec($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->cp_frec !== $v) {
			$this->cp_frec = $v;
			$this->modifiedColumns[] = MujeresPeer::CP_FREC;
		}

	} 
	
	public function setProEmb($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->pro_emb !== $v) {
			$this->pro_emb = $v;
			$this->modifiedColumns[] = MujeresPeer::PRO_EMB;
		}

	} 
	
	public function setMamografia($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->mamografia !== $v) {
			$this->mamografia = $v;
			$this->modifiedColumns[] = MujeresPeer::MAMOGRAFIA;
		}

	} 
	
	public function setIts($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->its !== $v) {
			$this->its = $v;
			$this->modifiedColumns[] = MujeresPeer::ITS;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->id = $rs->getInt($startcol + 0);

			$this->numhistoria = $rs->getInt($startcol + 1);

			$this->ginocologo = $rs->getBoolean($startcol + 2);

			$this->cito = $rs->getBoolean($startcol + 3);

			$this->cito_frec = $rs->getString($startcol + 4);

			$this->resultado = $rs->getString($startcol + 5);

			$this->exa_gino = $rs->getString($startcol + 6);

			$this->embarazada = $rs->getBoolean($startcol + 7);

			$this->dudas = $rs->getBoolean($startcol + 8);

			$this->d_frec = $rs->getString($startcol + 9);

			$this->control = $rs->getString($startcol + 10);

			$this->cp_frec = $rs->getString($startcol + 11);

			$this->pro_emb = $rs->getString($startcol + 12);

			$this->mamografia = $rs->getString($startcol + 13);

			$this->its = $rs->getString($startcol + 14);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 15; 
		} catch (Exception $e) {
			throw new PropelException("Error populating Mujeres object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(MujeresPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			MujeresPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(MujeresPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


												
			if ($this->aHistoria !== null) {
				if ($this->aHistoria->isModified()) {
					$affectedRows += $this->aHistoria->save($con);
				}
				$this->setHistoria($this->aHistoria);
			}


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = MujeresPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += MujeresPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


												
			if ($this->aHistoria !== null) {
				if (!$this->aHistoria->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aHistoria->getValidationFailures());
				}
			}


			if (($retval = MujeresPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}



			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = MujeresPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getId();
				break;
			case 1:
				return $this->getNumhistoria();
				break;
			case 2:
				return $this->getGinocologo();
				break;
			case 3:
				return $this->getCito();
				break;
			case 4:
				return $this->getCitoFrec();
				break;
			case 5:
				return $this->getResultado();
				break;
			case 6:
				return $this->getExaGino();
				break;
			case 7:
				return $this->getEmbarazada();
				break;
			case 8:
				return $this->getDudas();
				break;
			case 9:
				return $this->getDFrec();
				break;
			case 10:
				return $this->getControl();
				break;
			case 11:
				return $this->getCpFrec();
				break;
			case 12:
				return $this->getProEmb();
				break;
			case 13:
				return $this->getMamografia();
				break;
			case 14:
				return $this->getIts();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = MujeresPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getId(),
			$keys[1] => $this->getNumhistoria(),
			$keys[2] => $this->getGinocologo(),
			$keys[3] => $this->getCito(),
			$keys[4] => $this->getCitoFrec(),
			$keys[5] => $this->getResultado(),
			$keys[6] => $this->getExaGino(),
			$keys[7] => $this->getEmbarazada(),
			$keys[8] => $this->getDudas(),
			$keys[9] => $this->getDFrec(),
			$keys[10] => $this->getControl(),
			$keys[11] => $this->getCpFrec(),
			$keys[12] => $this->getProEmb(),
			$keys[13] => $this->getMamografia(),
			$keys[14] => $this->getIts(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = MujeresPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setId($value);
				break;
			case 1:
				$this->setNumhistoria($value);
				break;
			case 2:
				$this->setGinocologo($value);
				break;
			case 3:
				$this->setCito($value);
				break;
			case 4:
				$this->setCitoFrec($value);
				break;
			case 5:
				$this->setResultado($value);
				break;
			case 6:
				$this->setExaGino($value);
				break;
			case 7:
				$this->setEmbarazada($value);
				break;
			case 8:
				$this->setDudas($value);
				break;
			case 9:
				$this->setDFrec($value);
				break;
			case 10:
				$this->setControl($value);
				break;
			case 11:
				$this->setCpFrec($value);
				break;
			case 12:
				$this->setProEmb($value);
				break;
			case 13:
				$this->setMamografia($value);
				break;
			case 14:
				$this->setIts($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = MujeresPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setNumhistoria($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setGinocologo($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setCito($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setCitoFrec($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setResultado($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setExaGino($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setEmbarazada($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setDudas($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setDFrec($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setControl($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setCpFrec($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setProEmb($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setMamografia($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setIts($arr[$keys[14]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(MujeresPeer::DATABASE_NAME);

		if ($this->isColumnModified(MujeresPeer::ID)) $criteria->add(MujeresPeer::ID, $this->id);
		if ($this->isColumnModified(MujeresPeer::NUMHISTORIA)) $criteria->add(MujeresPeer::NUMHISTORIA, $this->numhistoria);
		if ($this->isColumnModified(MujeresPeer::GINOCOLOGO)) $criteria->add(MujeresPeer::GINOCOLOGO, $this->ginocologo);
		if ($this->isColumnModified(MujeresPeer::CITO)) $criteria->add(MujeresPeer::CITO, $this->cito);
		if ($this->isColumnModified(MujeresPeer::CITO_FREC)) $criteria->add(MujeresPeer::CITO_FREC, $this->cito_frec);
		if ($this->isColumnModified(MujeresPeer::RESULTADO)) $criteria->add(MujeresPeer::RESULTADO, $this->resultado);
		if ($this->isColumnModified(MujeresPeer::EXA_GINO)) $criteria->add(MujeresPeer::EXA_GINO, $this->exa_gino);
		if ($this->isColumnModified(MujeresPeer::EMBARAZADA)) $criteria->add(MujeresPeer::EMBARAZADA, $this->embarazada);
		if ($this->isColumnModified(MujeresPeer::DUDAS)) $criteria->add(MujeresPeer::DUDAS, $this->dudas);
		if ($this->isColumnModified(MujeresPeer::D_FREC)) $criteria->add(MujeresPeer::D_FREC, $this->d_frec);
		if ($this->isColumnModified(MujeresPeer::CONTROL)) $criteria->add(MujeresPeer::CONTROL, $this->control);
		if ($this->isColumnModified(MujeresPeer::CP_FREC)) $criteria->add(MujeresPeer::CP_FREC, $this->cp_frec);
		if ($this->isColumnModified(MujeresPeer::PRO_EMB)) $criteria->add(MujeresPeer::PRO_EMB, $this->pro_emb);
		if ($this->isColumnModified(MujeresPeer::MAMOGRAFIA)) $criteria->add(MujeresPeer::MAMOGRAFIA, $this->mamografia);
		if ($this->isColumnModified(MujeresPeer::ITS)) $criteria->add(MujeresPeer::ITS, $this->its);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(MujeresPeer::DATABASE_NAME);

		$criteria->add(MujeresPeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setNumhistoria($this->numhistoria);

		$copyObj->setGinocologo($this->ginocologo);

		$copyObj->setCito($this->cito);

		$copyObj->setCitoFrec($this->cito_frec);

		$copyObj->setResultado($this->resultado);

		$copyObj->setExaGino($this->exa_gino);

		$copyObj->setEmbarazada($this->embarazada);

		$copyObj->setDudas($this->dudas);

		$copyObj->setDFrec($this->d_frec);

		$copyObj->setControl($this->control);

		$copyObj->setCpFrec($this->cp_frec);

		$copyObj->setProEmb($this->pro_emb);

		$copyObj->setMamografia($this->mamografia);

		$copyObj->setIts($this->its);


		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new MujeresPeer();
		}
		return self::$peer;
	}

	
	public function setHistoria($v)
	{


		if ($v === null) {
			$this->setNumhistoria(NULL);
		} else {
			$this->setNumhistoria($v->getNumhistoria());
		}


		$this->aHistoria = $v;
	}


	
	public function getHistoria($con = null)
	{
		if ($this->aHistoria === null && ($this->numhistoria !== null)) {
						$this->aHistoria = HistoriaPeer::retrieveByPK($this->numhistoria, $con);

			
		}
		return $this->aHistoria;
	}

} 